package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * TODO
 *
 * @author caiyonglan
 * @email 627064518@qq.com
 * @date 2020/12/3 21:28
 */
@Data
@Getter
@Setter
@ToString
@ApiModel(value = "用户", description = "描述用户实体")
@Accessors(chain = true)
public class User {

    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键id")
    private Integer id;

    @ApiModelProperty(value = "用户名", example = "user1")
    private String username;

    @ApiModelProperty(value = "密码", example = "user1")
    @TableField(select = false)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String password;

    @ApiModelProperty(value = "年龄", example = "14")
    private Integer age;

    @ApiModelProperty(value = "性别(0代表女，1代表男)", example = "1")
    private Integer sex;

    @TableLogic
    @TableField(select = false)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "逻辑删除标识(0代表未删除，1代表已删除)", example = "0")
    private Integer deleted;

}
